package com.xmg.shop.api.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.io.Serializable;
import java.util.*;

@Setter@Getter
public class Brand extends BaseDomain{

    private Date createdDate;//创建时间

    private Date lastModifiedDate;//最后修改时间

    private int version;//版本控制

    private Date foundDate;//建立时间

    private String logo;//品牌图片

    private String chineseName;//中文名

    private String englishName;//英文名

    private String description;//描述

    private String url;//品牌网址

    private Integer sequence;//排序

    private Long mods;//是否显示

    private String area;//区域

    private List<Catalog> catalogList = new ArrayList<Catalog>();//品牌分类集合

    public String getJsonString(){
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("id",this.id);
        map.put("chineseName",chineseName);
        map.put("englishName",englishName);
        map.put("url",url);
        map.put("area",area);
        map.put("logo",logo);
        map.put("description",description);
        map.put("sequence",sequence);
        map.put("mods",mods);
        map.put("catalogList",catalogList);
        return JSON.toJSONString(map);
    }

    public String getIsMods(){
        return mods==1?"是":"否";
    }
}